import { useRoutes } from 'react-router-dom'
import { Suspense } from 'react'
import './App.css'
import routes from './routes'
import { Provider } from 'react-redux'
import store from './store'

const Loading = () => <div>Loading...</div>;

function App() {
  const element = useRoutes(routes)
  return (
    <div id='root'>
      <Suspense fallback={<Loading />}>
        <Provider store={store}>
          {element}
        </Provider>
      </Suspense>
    </div>
  )
}

export default App
